﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace CommonMvc.Models
{
    public class BaseResult :BasicModel
    {
        //请求处理的状态
        public int ResultCode { get; set; }
        //请求处理的相关提示,出错时会有用
        public String Message { get; set; }
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        public object Data { get; set; }
    }

    public class PageModel : BasicModel {
        //[Range(1,UInt64.MaxValue,ErrorMessage = "最小1  UInt64.MaxValue")]
        public int CurrentPage { get; set; }
        //[Range(1,100,ErrorMessage ="最小1  最大100")]
        public int PageSize { get; set; }
    }
    public class BaseListResult : BaseResult {
        public PageModel Page { get; set; }
    }

    public class IdModel : BasicModel {
        [Range(1, UInt64.MaxValue, ErrorMessage = "最小1  最大UInt64.MaxValue ")]
        public int Id { get; set; }
    }
}
